package cn.edu.zju.gis.disasterBE.sever.controller;

import cn.edu.zju.gis.disasterBE.sever.commons.annotation.PassToken;
import cn.edu.zju.gis.disasterBE.sever.entity.Twitter;
import cn.edu.zju.gis.disasterBE.sever.entity.global.MyResponse;
import cn.edu.zju.gis.disasterBE.sever.service.TwitterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api("社交媒体模块")
@RestController
@RequestMapping("/media")
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
public class TwitterController {
    private final TwitterService twitterService;

    @PassToken
    @ApiOperation("获得数据库中12条推特")
    @GetMapping("/twitterGet12")
    public MyResponse<List<Twitter>> twitterGet()
    {
        return twitterService.twitterGet12();
    }

}
